var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var myname = "madison";
var getName = function () {
    return "madison";
};
console.log("hello " + myname);
console.log("hello " + getName());
console.log("<div>\n<span>" + myname + "</span>\n<span>" + getName() + "</span>\n<div>xxxx</div>\n</div>\n");
function test(templete, name, age) {
    console.log(templete);
    console.log(name);
    console.log(age);
}
var getAge = function () {
    return 18;
};
test(__makeTemplateObject(["hello my name is ", ", i'm ", ""], ["hello my name is ", ", i'm ", ""]), myname, getAge());
var myname = 'zs';
myname = 23;
//类型推断
var alias = 'xixi';
alias = 12;
var yourname = "sd";
yourname = 3;
var age = 2;
var man = false;
function test1(name) {
    return '';
}
test1('23');
var Person = /** @class */ (function () {
    function Person() {
    }
    return Person;
}());
var zhuangsen = new Person();
zhuangsen.name = 'zs';
zhuangsen.age = 18;
var myname = 'sd';
function test3(a, b, c) {
    if (c === void 0) { c = 'cc'; }
    console.log(a);
    console.log(b);
    console.log(c);
}
test3('a', 'b');
test3('aa');
var args = ['a1', 'b2', 'c3'];
test3.apply(void 0, args);
function fun1() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    args.forEach(function (arg) {
        console.log(arg);
    });
}
fun1(1, 2, 3);
fun1(1, 2, 3, 4, 5);
function getStock() {
    return {
        code: 'IBM',
        price: 100
    };
}
function getStock1() {
    return {
        code: 'IBM',
        price: {
            price1: 100,
            price2: 200
        },
        aaa: 'xixi',
        bbb: 'haha'
    };
}
var stock = getStock();
var code = stock.code;
var price = stock.price;
//析构表达式
var _a = getStock(), code = _a.code, price = _a.price;
var _b = getStock(), codex = _b.code, price = _b.price;
var _c = getStock1(), code = _c.code, _d = _c.price, price1 = _d.price1, price2 = _d.price2;
var array1 = [1, 2, 3, 4, '2'];
var number1 = array1[0], number2 = array1[3];
var number1 = array1[0], number2 = array1[1], others = array1.slice(2);
function doSomething(_a) {
    var number1 = _a[0], number2 = _a[1], others = _a.slice(2);
    console.log(number1);
    console.log(number2);
    console.log(others);
}
doSomething(array1);
var sum = function (arg1, arg2) { return arg1 + arg2; };
var sum = function (arg1) {
    console.log(arg1);
};
var myArray = [1, 2, 3, 4];
console.log(myArray.filter(function (value) { return value % 2; }));
function getStock2(name) {
    this.name = name;
    setInterval(function () {
        console.log('name is :' + this.name);
    }, 1000);
}
var stock = new getStock2("IBM");
function getStock2(name) {
    var _this = this;
    this.name = name;
    setInterval(function () {
        console.log('name is :' + _this.name);
    }, 1000);
}
var myArray = [1, 2, 3, 4];
myArray.desc = 'four number';
myArray.forEach(function (value) { return console.log(value); });
for (var n in myArray) {
    console.log(n);
    console.log(myArray[n]);
}
for (var _i = 0, myArray_1 = myArray; _i < myArray_1.length; _i++) {
    var n = myArray_1[_i];
    console.log(n);
}
